# 训练循环（伪代码）
def train(model, train_loader, optimizer, num_epochs):
    for epoch in range(num_epochs):
        for batch in train_loader:
            image_1, image_2, boundary_box_label_1, boundary_box_label_2, damage_type = batch
            image_merged, outputs = model(image_1, image_2)
            loss = compute_loss(outputs, boundary_box_label_1, damage_type, model.stn.transformed_boxes, boundary_box_label_2)
            optimizer.zero_grad()
            loss.backward()
            optimizer.step()
            print(f"Epoch {epoch}, Loss: {loss.item()}")